package com.springboot.java.design.adapter;

/**
 * @Author: TongRui乀
 * @Date: 2019/3/5 16:34
 * @description： 鸭子 对象适配器   将鸭子适配成鸡
 */
public class DuckAdapter implements Duck{

    private Cock cock;

    public DuckAdapter(Cock cock){
        this.cock = cock;
    }

    @Override
    public void quack() {
        cock.gobble();
    }

    @Override
    public void fly() {
        cock.fly();
    }
}
